<template xmlns="http://www.w3.org/1999/html">
  <div style="height: 100%; width: 100%">

    <div class="wrapper">
      <a-card class="wrapper">
        <template #cover>
          <img alt="example" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" />
        </template>
        <a-card-meta title="Europe Street beat">
          <template #description>www.instagram.com</template>
        </a-card-meta>
      </a-card>
    </div>

    <van-list
        v-model:loading="loading"
        :finished="finished"
        finished-text="没有更多了"
        @load="onLoad"
    >
      <van-cell v-for="item in list" :key="item" :title="item" />
    </van-list>

  </div>
</template>

<script>
import request from "../utils/axios";
import {setRefreshToekn, setToken, setTokenHead} from "../utils/auth";
import {setUserInfo} from "../utils/owninfo";

export default {
  name: 'HelloWorld',
  props: {
    // msg: String
  },
  data() {
    return {
      count: 0,
      username: "",
      password:"",
    }
  },
  methods: {
    Login(){
      request({
        url: '/auth/oauth/token',
        method: 'post',
        params:{
          username: this.username,
          password: this.password,
          grant_type: 'password',
          client_id: 'client-app',
          client_secret: '123456',
        }
      }).then(response => {
        console.info(response)
        setTokenHead("Bearer")
        setToken(response.access_token)
        setRefreshToekn(response.refresh_token)
        setUserInfo(response.id)
      }).catch(error => {
        console.info(error)
      })
    },
  }
};
</script>
